package com.oscarmovie.model;

import java.util.Set;

public class Music {
	private int id;
	private String name;
	private String nameCn;
	
	private Movie movie;
	private Language language;
	
	private Set<Audio> audios;
	private String displayName;

	public String getDisplayName() {
		if (displayName == null) {
			displayName = name;
			if (!"".equals(name)) {
				displayName += " (" + nameCn + ")";
			}
		}
		return displayName;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNameCn() {
		return nameCn;
	}
	public void setNameCn(String nameCn) {
		this.nameCn = nameCn;
	}
	public Movie getMovie() {
		return movie;
	}
	public void setMovie(Movie movie) {
		this.movie = movie;
	}
	public void setAudios(Set<Audio> audios) {
		this.audios = audios;
	}
	public Set<Audio> getAudios() {
		return audios;
	}
	public void setLanguage(Language language) {
		this.language = language;
	}
	public Language getLanguage() {
		return language;
	}
	public int hashCode() {
		return this.id;
	}
	public boolean equals(Object object) {
		boolean t = false;
		if (object != null) {
			Music music = (Music) object;
			t = music.getId() == this.getId();
		}
		return t;
	}
	
}
